package com.shuqi.activity.viewport;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.shuqi.controller.R;

/**
 * 搜索主页gallery作为头部文件
 * 
 * @author linyuren
 * 
 */
public class BookSearchGalleryHead extends LinearLayout {

    private Context context;

    // private TextView textView;

    public BookSearchGalleryHead(Context context) {
        super(context);
        this.context = context;
        View view = LayoutInflater.from(this.context).inflate(R.layout.search_gallery_head, null);

        ViewGroup.LayoutParams params =
                new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
                        ViewGroup.LayoutParams.WRAP_CONTENT);
        view.setLayoutParams(params); // 设置view为占满横屏整个屏幕

        // 以下两句的顺序不能调换，要先addView，然后才能通过findViewById找到该TextView
        addView(view);
        // textView = (TextView) view.findViewById(R.id.search_gallery_desc);
    }

    // public void setTextView(String text) {
    // textView.setText(text);
    // }
}
